fix(commands): transfer abs_fnames back after /agent temp-coder turn#568
Merged
dwash96 merged 1 commit intoJun 12, 2026
Merged
Conversation
_generic_chat_command creates a temporary coder for /agent (and other
slash commands with args). Files added by ContextManager during the
turn were on the temp coder and got discarded when SwitchCoderSignal
switched back to the original.
Now transfer abs_fnames and abs_read_only_fnames from the temp coder
back to the original before raising SwitchCoderSignal. This ensures
files added during /agent turns persist in the session and are visible
to subsequent GET /sessions/{id} (files_in_chat).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
_generic_chat_commandcreates a temporary coder for/agent(and other slash commands with args). Files added by ContextManager during the turn were on the temp coder and got discarded whenSwitchCoderSignalswitched back to the original.Now transfers
abs_fnamesandabs_read_only_fnamesfrom the temp coder back to the original before raisingSwitchCoderSignal. This ensures files added during/agentturns persist in the session and are visible to subsequentGET /sessions/{id}(files_in_chat).Test plan
python -m pytest tests/ -x -q(414 passed)files_in_chatnow reflects ContextManager-added files after /agent turn completes